//
//  MineStyle2Cell.swift
//  HappyEat
//8.5 13.5
//  Created by ctx2016 on 17/1/9.
//  Copyright © 2017年 陌路是我. All rights reserved.
//

import UIKit

class MineStyle2Cell: UITableViewCell {
    
    let iconImageView:UIImageView = UIImageView.init()
    let titleLabel:UILabel = UILabel.init()
    let bottomLabel:UILabel = UILabel.init()
    let right_Icon:UIImageView = UIImageView.init()
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        self.right_Icon.snp.makeConstraints { (make) in
            make.right.equalTo(-16)
            make.width.equalTo(8.5)
            make.height.equalTo(13.5)
            make.top.equalTo((45-13.5)/2)
        }
        self.iconImageView.snp.makeConstraints { (make) in
            make.left.equalTo(16)
            make.size.equalTo(CGSize.init(width: 20, height: 20))
            make.top.equalTo((45-20)/2)
        }
        self.titleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(self.iconImageView.snp.right).offset(10)
            make.right.equalTo(self.right_Icon.snp.left).offset(-10)
            make.top.equalTo((45-15)/2)
            make.height.equalTo(15)
        }
        self.bottomLabel.snp.makeConstraints { (make) in
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.bottom.equalTo(0)
            make.height.equalTo(0.5)
        }
    }
}
extension MineStyle2Cell{
    func setUI(){
        self.contentView.addSubview(iconImageView)
        self.contentView.addSubview(titleLabel)
        self.contentView.addSubview(bottomLabel)
        self.contentView.addSubview(self.right_Icon)
        self.bottomLabel.backgroundColor = .lightGray
        self.titleLabel.font = UIFont.systemFont(ofSize: 15)
        self.right_Icon.image = UIImage.init(named: "icon-detail")
    }
}
